<style>
    .table-responsive {overflow-x: inherit}
    td {vertical-align: middle !important;}
    .node-list li{display: inline-block}
    .buttonbor{display: block;border-bottom: 10px solid #fff;}

</style>
<div>
    <div class="bg-light lter b-b wrapper-md">
        <h1 class="m-n font-thin h3">退货单
            <div class="pull-right">
                <a  class="btn btn-sm btn-default" onclick="history.go(-1)">返回列表</a>
            </div>
        </h1>
    </div>
    <div class="padder-md m-b-none m-t" style="padding-top: 0">
        <div>
            <div class="col-sm-12">
                <div class="panel panel-default">
                    <div class="panel-heading font-bold">商品信息</div>
                    <div class="panel panel-default">
                        <div class="panel-body">
                            <div class="table-responsive">
                                <table class="table table-striped table-bordered b-t b-light">
                                    <thead>
                                    <tr>
                                        <th>id</th>
                                        <th width="20%">名称</th>
                                        <th>规格</th>
                                        <th>数量</th>
                                        <th>订单金额</th>
                                        <th>小计</th>
                                    </tr>
                                    </thead>
                                    <tbody>
                                    <tr>
                                        <td>{{ctrl.vm.data.id}}</td>
                                        <td>{{ctrl.vm.data.p_name}}</td>
                                        <td>{{ctrl.vm.data.p_attr_value_set_name}}</td>
                                        <td>{{ctrl.vm.data.qty}}</td>
                                        <td>{{ctrl.vm.data.price|currency : '$'}}</td>
                                        <td>{{ctrl.vm.data.price*ctrl.vm.data.qty|currency : '$'}}</td>

                                    </tr>
                                    <tr ng-if="ctrl.vm.data.length==0">
                                        <td colspan="12" class="text-center">暂无数据！</td>
                                    </tr>
                                    </tbody>
                                </table>
                            </div>
                        </div>
                    </div>
                </div>
            </div>

            <div class="col-sm-12" ng-if="ctrl.vm.data.message!=''">
                <div class="panel panel-default">
                    <div class="panel-heading font-bold">客户留言</div>
                    <div class="panel-body">
                        <form role="form" class="ng-pristine ng-valid">
                            <div class="form-group" style="width: 50%">
                                <label style="width: 15%;text-align: right">客户留言 ：  </label>{{ctrl.vm.data.message}}
                                <i class="pull-right">{{ctrl.vm.data.created_at}}</i>
                            </div>
                        </form>
                    </div>
                </div>
            </div>

            <div class="col-sm-12" ng-if="ctrl.vm.data.image_1!=''||ctrl.vm.data.image_2!=''||ctrl.vm.data.image_3!=''">
                <div class="panel panel-default">
                    <div class="panel-heading font-bold">客户图片</div>
                        <div class="panel-body">
                            <img  ng-src="{{ctrl.vm.data.image_1 | imgwhq:200:200:90}}" alt="">
                            <img  ng-src="{{ctrl.vm.data.image_2 | imgwhq:200:200:90}}" alt="" style="padding: 0 5px">
                            <img  ng-src="{{ctrl.vm.data.image_3 | imgwhq:200:200:90}}" alt="">
                        </div>
                        <div class="panel-body">
                            <div ng-if="ctrl.vm.data.image_1==''&&ctrl.vm.data.image_2==''&&ctrl.vm.data.image_3==''" style="text-align: center">无</div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="panel panel-default">
                    <div class="panel-heading font-bold">操作</div>
                        <div class="panel-body">
                            <div class="col-sm-4"
                                 ng-if="ctrl.vm.data.type==1&&ctrl.vm.data.status==1||ctrl.vm.data.type==2&&ctrl.vm.data.status==1||ctrl.vm.data.type==3&&ctrl.vm.data.status==1">
                                <div class="form-group row" style="padding-top: 15px">
                                    <label class="col-sm-4 control-label text-right" style="padding-top: 5px">状态:</label>
                                    <div class="col-sm-6">
                                        <span class="label bg-warning" ng-if="ctrl.vm.data.status==1">待审核 </span>
                                        <span class="label bg-success" ng-if="ctrl.vm.data.status==2">同意申请</span>
                                        <span class="label bg-info" ng-if="ctrl.vm.data.status==3">客服收到退换货商品</span>
                                        <span class="label bg-dark" ng-if="ctrl.vm.data.status==4">结束</span>
                                        <span class="label bg-danger" ng-if="ctrl.vm.data.status==-1">拒绝退换货</span>
                                    </div>
                                </div>
                                <div class="form-group row" style="padding-top: 15px">
                                    <label class="col-sm-4 control-label text-right" style="padding-top: 5px">申请类型:</label>
                                    <div class="col-sm-6">
                                        <span class="label bg-danger" ng-if="ctrl.vm.data.type==1">退货 </span>
                                        <span class="label bg-warning" ng-if="ctrl.vm.data.type==2">换货</span>
                                        <span class="label bg-info" ng-if="ctrl.vm.data.type==3">维修</span>
                                    </div>
                                </div>
                                <div class="form-group row" style="padding-top: 15px">
                                    <label class="col-sm-4 control-label text-right" style="padding-top: 5px">备注:</label>
                                    <div class="col-sm-6">
                                        <textarea ng-model="ctrl.vm.data.comment1" class="form-control" style="width: 250px"></textarea>
                                    </div>
                                </div>
                                <div class="modal-footer" style="border: none;padding-right: 31.5%">
                                    <button class="btn btn-sm btn-success" ng-click="ctrl.vm.pass(ctrl.vm.data.id)">通过</button>
                                    <button class="btn btn-sm btn-danger" ng-click="ctrl.vm.reject(ctrl.vm.data.id)">驳回</button>
                                </div>
                            </div>

                            <div class="col-sm-4"
                                 ng-if="ctrl.vm.data.type==1&&ctrl.vm.data.status==2||ctrl.vm.data.type==2&&ctrl.vm.data.status==2||ctrl.vm.data.type==3&&ctrl.vm.data.status==2">
                                <div class="form-group row" style="padding-top: 15px">
                                    <label class="col-sm-4 control-label text-right" style="padding-top: 5px">状态:</label>
                                    <div class="col-sm-6">
                                        <span class="label bg-warning" ng-if="ctrl.vm.data.status==1">待审核 </span>
                                        <span class="label bg-success" ng-if="ctrl.vm.data.status==2">同意申请</span>
                                        <span class="label bg-info" ng-if="ctrl.vm.data.status==3">客服收到退换货商品</span>
                                        <span class="label bg-dark" ng-if="ctrl.vm.data.status==4">结束</span>
                                        <span class="label bg-danger" ng-if="ctrl.vm.data.status==-1">拒绝退换货</span>
                                    </div>
                                </div>
                                <div class="form-group row" style="padding-top: 15px">
                                    <label class="col-sm-4 control-label text-right" style="padding-top: 5px">申请类型:</label>
                                    <div class="col-sm-6">
                                        <span class="label bg-danger" ng-if="ctrl.vm.data.type==1">退货 </span>
                                        <span class="label bg-warning" ng-if="ctrl.vm.data.type==2">换货</span>
                                        <span class="label bg-info" ng-if="ctrl.vm.data.type==3">维修</span>
                                    </div>
                                </div>
                                <div class="form-group row" style="padding-top: 15px">
                                    <label class="col-sm-4 control-label text-right" style="padding-top: 5px">备注:</label>
                                    <div class="col-sm-6">
                                        <textarea ng-model="ctrl.vm.data.comment2" class="form-control" style="width: 250px"></textarea>
                                    </div>
                                </div>
                                <div class="modal-footer" style="border: none;padding-right: 42%">
                                    <button class="btn btn-sm btn-success" ng-click="ctrl.vm.receive(ctrl.vm.data.id)">收货</button>
                                </div>
                            </div>

                            <div class="col-sm-4"
                                 ng-if="ctrl.vm.data.type==1&&ctrl.vm.data.status==3||ctrl.vm.data.type==2&&ctrl.vm.data.status==3||ctrl.vm.data.type==3&&ctrl.vm.data.status==3">
                                <div class="form-group row" style="padding-top: 15px">
                                    <label class="col-sm-4 control-label text-right" style="padding-top: 5px">状态:</label>
                                    <div class="col-sm-6">
                                        <span class="label bg-warning" ng-if="ctrl.vm.data.status==1">待审核 </span>
                                        <span class="label bg-success" ng-if="ctrl.vm.data.status==2">同意申请</span>
                                        <span class="label bg-info" ng-if="ctrl.vm.data.status==3">客服收到退换货商品</span>
                                        <span class="label bg-dark" ng-if="ctrl.vm.data.status==4">结束</span>
                                        <span class="label bg-danger" ng-if="ctrl.vm.data.status==-1">拒绝退换货</span>
                                    </div>
                                </div>
                                <div class="form-group row" style="padding-top: 15px">
                                    <label class="col-sm-4 control-label text-right" style="padding-top: 5px">申请类型:</label>
                                    <div class="col-sm-6">
                                        <span class="label bg-danger" ng-if="ctrl.vm.data.type==1">退货 </span>
                                        <span class="label bg-warning" ng-if="ctrl.vm.data.type==2">换货</span>
                                        <span class="label bg-info" ng-if="ctrl.vm.data.type==3">维修</span>
                                    </div>
                                </div>
                                <div class="form-group row" style="padding-top: 15px">
                                    <label class="col-sm-4 control-label text-right" style="padding-top: 5px">备注:</label>
                                    <div class="col-sm-6">
                                        <textarea ng-model="ctrl.vm.data.comment3" class="form-control" style="width: 250px"></textarea>
                                    </div>
                                </div>
                                <div class="modal-footer" style="border: none;padding-right: 42%">
                                    <button class="btn btn-sm btn-danger" ng-click="ctrl.vm.over(ctrl.vm.data.id)">结束</button>
                                </div>
                            </div>

                            <div class="col-sm-4" ng-if="ctrl.vm.data.status==4">
                                <div class="form-group row" style="padding-top: 15px">
                                    <label class="col-sm-4 control-label text-right" style="padding-top: 5px">状态:</label>
                                    <div class="col-sm-6">
                                        <span class="label bg-warning" ng-if="ctrl.vm.data.status==1">待审核 </span>
                                        <span class="label bg-success" ng-if="ctrl.vm.data.status==2">同意申请</span>
                                        <span class="label bg-info" ng-if="ctrl.vm.data.status==3">客服收到退换货商品</span>
                                        <span class="label bg-dark" ng-if="ctrl.vm.data.status==4">结束</span>
                                        <span class="label bg-danger" ng-if="ctrl.vm.data.status==-1">拒绝退换货</span>
                                    </div>
                                </div>
                                <div class="form-group row" style="padding-top: 15px">
                                    <label class="col-sm-4 control-label text-right" style="padding-top: 5px">申请类型:</label>
                                    <div class="col-sm-6">
                                        <span class="label bg-danger" ng-if="ctrl.vm.data.type==1">退货 </span>
                                        <span class="label bg-warning" ng-if="ctrl.vm.data.type==2">换货</span>
                                        <span class="label bg-info" ng-if="ctrl.vm.data.type==3">维修</span>
                                    </div>
                                </div>
                                <div class="form-group row" style="padding-top: 15px">
                                    <label class="col-sm-4 control-label text-right" style="padding-top: 5px">是否恢复库存:</label>
                                    <div class="col-sm-6">
                                        <span class="label bg-success" ng-if="ctrl.vm.data.stock_back ==1">已恢复</span>
                                        <span class="label bg-dark" ng-if="ctrl.vm.data.stock_back ==0">未恢复</span>
                                    </div>
                                </div>
                                <div class="form-group row" style="padding-top: 15px">
                                    <label class="col-sm-4 control-label text-right" style="padding-top: 5px">备注:</label>
                                    <div class="col-sm-6">
                                        <textarea ng-model="ctrl.vm.data.comment5" class="form-control" style="width: 250px"></textarea>
                                    </div>
                                </div>
                                <div class="modal-footer" style="border: none;padding-right: 42%">
                                    <button class="btn btn-sm btn-primary" ng-click="ctrl.vm.remark(ctrl.vm.data.id)">备注</button>
                                </div>
                            </div>
                            <div class="panel-body text-center" ng-if="ctrl.vm.data.status==-1">
                                暂无可操作项
                            </div>
                        </div>
                    </div>
                </div>
            <div>
            <div class="col-sm-6">
                <div class="panel panel-default">
                    <div class="panel-heading font-bold">恢复库存</div>
                    <div class="panel-body" ng-if="ctrl.vm.data.stock_back==0&&ctrl.vm.data.status==4&&ctrl.vm.data.type==1">
                        <div class="form-group row" style="padding-top: 15px">
                            <label class="col-sm-2 control-label text-right" style="padding-top: 5px">数量:</label>
                            <div class="col-sm-6">
                                <input type="text" class="form-control" ng-model="ctrl.vm.data.num" required="required" >
                            </div>
                        </div>
                        <div class="form-group row" style="padding-top: 15px">
                            <label class="col-sm-2 control-label text-right" style="padding-top: 5px">备注:</label>
                            <div class="col-sm-6">
                                <textarea ng-model="ctrl.vm.data.comment4" class="form-control" style="width: 250px"></textarea>
                            </div>
                        </div>
                        <div class="modal-footer" style="border: none;padding-right: 73.5%">
                            <button class="btn btn-sm btn-success" ng-click="ctrl.vm.renew(ctrl.vm.data.id)">恢复库存</button>
                        </div>
                    </div>
                    <div class="panel-body text-center" ng-if="ctrl.vm.data.stock_back==1">
                        库存已恢复
                    </div>
                    <div class="panel-body text-center" ng-if="ctrl.vm.data.stock_back==0&&ctrl.vm.data.status!=4">
                        暂无可操作项
                    </div>
                </div>
            </div>
            <div class="col-sm-6" ng-if="ctrl.vm.data.status==3">
                <div class="panel panel-default">
                    <div class="panel-heading font-bold">退款</div>
                    <div class="panel-body">
                        <div class="form-group row" style="padding-top: 15px">
                            <label class="col-sm-2 control-label text-right" style="padding-top: 5px">退款金额:</label>
                            <div class="col-sm-6">
                                <input type="text" class="form-control" ng-model="ctrl.vm.data.refund" required="required" >
                            </div>
                        </div>
                        <div class="form-group row" style="padding-top: 15px">
                            <label class="col-sm-2 control-label text-right" style="padding-top: 5px">备注:</label>
                            <div class="col-sm-6">
                                <textarea ng-model="ctrl.vm.data.comment6" class="form-control" style="width: 250px"></textarea>
                            </div>
                        </div>
                        <div class="modal-footer" style="border: none;padding-right: 76.5%">
                            <button class="btn btn-sm btn-primary" ng-click=" ctrl.vm.refund(ctrl.vm.data.id)">退款</button>
                        </div>
                    </div>
                </div>
            </div>
                <div class="col-sm-12">
                    <div class="panel panel-default">
                        <div class="panel-heading font-bold">备注</div>
                        <div class="panel-body">
                            <div class="col-sm-4" ng-repeat="data in ctrl.vm.data.comment" style="border-top: 1px solid #e5e5e5;border-left: 5px solid #fff;border-bottom: 5px solid #fff;background-color: #F6F8F8">
                                <div class="form-group row" style="padding-top: 15px">
                                    <label ng-if="data.worker_id>0" class="col-sm-2 control-label text-right" style="padding-top: 5px">管理员:</label>
                                    <label ng-if="data.worker_id==0" class="col-sm-2 control-label text-right" style="padding-top: 5px">系统:</label>
                                    <div class="col-sm-6" style="padding-top: 4px">
                                        {{data.worker_id}}
                                    </div>
                                </div>
                                <div class="form-group row" style="padding-top: 15px">
                                    <label class="col-sm-2 control-label text-right" style="padding-top: 5px">时间:</label>
                                    <div class="col-sm-6" style="padding-top: 4px">
                                        {{data.created_at}}
                                    </div>
                                </div>
                                <div class="form-group row" style="padding-top: 15px">
                                    <label class="col-sm-2 control-label text-right" style="padding-top: 5px">内容:</label>
                                    <div class="col-sm-6" style="padding-top: 4px">
                                        {{data.comment}}
                                    </div>
                                </div>
                            </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>